# -*- coding:utf-8 -*-

from django.conf.urls import url
from views import MaintainListCreateView, MaintainDetailView, TaskView, TaskDetailView, MaintainHistoryListView, \
    MaintainHistoryDetailView, TaskHistoryListView, GetElevatorPersonView, TaskNotDoneStatisticView, TaskSubmitView, \
    TaskResultRetrieveAndUpdateView, TaskPushBackView, TaskExportView, TaskExportViewLevel2, TaskSubmitForWrongTaskView
from view_app import AppTaskListView, AppTaskView, AppPositionView, AppWbItemsView, AppTaskStatusView, \
    AppPropertyTaskStatusView, AppTaskScanView, AppDataStorageCreateView, AppWbSubmitView, AppCodeMapToContent, \
    AppGetForMeView, AppCountForMeView, AppUpdateTaskForMeView


urlpatterns = [
    url(r"^contract/$", MaintainListCreateView.as_view(), name="create_or_list"),
    url(r"^contract/(?P<pk>\d+)/$", MaintainDetailView.as_view(), name="update_retrieve_destroy"),
    url(r"^task/$", TaskView.as_view(), name="create_list_bulk_delete"),
    url(r"^task/(?P<pk>\d+)/$", TaskDetailView.as_view(), name="update_retrieve_destroy"),
    url(r"^app/task/$", AppTaskListView.as_view(), name="task_list"),
    url(r"^app/task/(?P<pk>\d+)/$", AppTaskView.as_view(), name="list_retrieve"),
    url(r"^app/items/", AppWbItemsView.as_view(), name="item-list"),
    url(r"app/transfer/$", AppGetForMeView.as_view(), name="list"),
    url(r"app/count/$", AppCountForMeView.as_view(), name="number"),
    url(r"^app/contents/$", AppCodeMapToContent.as_view(), name="contents-list"),
    url(r"^app/submit/$", AppWbSubmitView.as_view(), name="submit"),
    url(r"^app/revision/$", AppUpdateTaskForMeView.as_view(), name="transfer-update"),
    url(r"^app/positions/", AppPositionView.as_view(), name="positions-list"),
    url(r"^app/status/(?P<pk>\d+)/$", AppTaskStatusView.as_view(), name="status"),
    url(r"^app/confirm/(?P<pk>\d+)/$", AppPropertyTaskStatusView.as_view(), name="status"),
    url(r"^app/auto/$", AppTaskScanView.as_view(), name="auto"),
    url(r"^app/storage/$", AppDataStorageCreateView.as_view(), name="create-or-get"),
    url(r"^task/history/$", MaintainHistoryListView.as_view(), name="create_or_list"),
    url(r"^task/history/(?P<pk>\d+)/$", MaintainHistoryDetailView.as_view(), name="task_history_detail"),
    url(r"^task/history/list/$", TaskHistoryListView.as_view(), name="task_history_list"),
    url(r"^task/elevator/person/$", GetElevatorPersonView.as_view(), name="task_elevator_person"),
    url(r"^task/statistics/", TaskNotDoneStatisticView.as_view(), name="task_statistics"),
    url(r"^task/manu/submit/$", TaskSubmitForWrongTaskView.as_view(), name="submit-by-manu"),
    url(r"task/submit/$", TaskSubmitView.as_view(), name="task-submit"),
    url(r"task/retrieve/(?P<pk>\d+)/$", TaskResultRetrieveAndUpdateView.as_view(), name="task-result-retrieve"),
    url(r"task/pushback/$", TaskPushBackView.as_view(), name="task-push-back"),
    url(r"^task/pdf/$", TaskExportView.as_view(), name="task-to-pdf"),
    url(r"^task/download/$", TaskExportViewLevel2.as_view(), name="task-down")
]